<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <link rel="stylesheet" href="../css/bottom.css">
    <link rel="stylesheet" href="../css/header.css">
    <link rel="stylesheet" href="../css/reset.css">
    <link rel="stylesheet" href="../css/mian2.css">
</head>
<body>
    <header>
        <div class="banner">
            <div class="logo-no1">
                <span>
                    网络全案营销服务提供商
                </span>
            </div>
            <ul>
                <li><a href="">网站首页</a></li>
                <li><a href="">传悦资源</a></li>
                <li><a href="">传悦案例</a></li>
                <li><a href="">传悦服务</a></li>
                <li><a href="">解决方案</a></li>
                <li><a href="">需求提交</a></li>
            </ul>
            <div class="imgs">

            </div>
        </div>
    </header>
    <div class="second">
        <div class="second-now">

        </div>

        <ul>
            <li><a href="">上一个：开门红商城基础营销</a></li>
            <li><a href="">下一个：金数据全网整合营销</a></li>
        </ul>
    </div>
    <div class="last">
        <div class="last-middle">
            <div class="logo-last"></div>
            <div class="last-right">
                <ul>
                    <li><a href="">关于传悦</a></li>
                    <li><a href="">新闻动态</a></li>
                    <li><a href="">关于传悦</a></li>
                    <li><a href="">联系传悦</a></li>
                    <li><a href="">加入传悦</a></li>
                    <li><a href="">付款账户</a></li>
                </ul>
                <div>
                    Copyright&nbsp;2013&nbsp;创梦网络科技有限责任公司&nbsp;&nbsp;||&nbsp;&nbsp;传悦Chnyoo.cn All Rights Reserved&nbsp;&nbsp;京ICP备12005221号
                </div>
            </div>
        </div>
    </div>
</body>
</html>
<script src="jquery.min.js"></script>
<script>
    // let http = new XMLHttpRequest()
    // http.open('get','http://127.0.0.1:1000/had')
    // http.send()
    // http.onreadystatechange = function(){
    //     if(http.readyState === 4){
    //         let data = JSON.parse(http.responseText)
    //         let now = $(".second-now")
    //         data.forEach((item)=>{
    //             now.html(item.content)
    //         });
    //     }
    // }

    String.prototype.parseUrl = function(){
				let arr = this.slice(this.indexOf("?") + 1).split("&");
				let result = {}
				arr.forEach(item=>{
					let key = item.split("=")[0];
					let value = item.split("=")[1];
					
					result[key] = value;
				})
				return result;
			}
			
        $.ajax({
            url:"http://127.0.0.1:1000/getnews",
            data:{
                id:location.href.parseUrl().id
            },
            success(data){
                $(".second-now").html(data.content);
            }
        })
</script>